package GamePlay;

/**
 * GamePlay class
 * @author Daniel and Hardy
 *
 */

public class GamePlay {
	
	public int numVirusPerTurn = 5; // Piece placement per turn
	
	/**
	 * start - initial placement of pieces
	 */
	public boolean start(int counter) {
		if (counter > 1)
			return true;
		return false;
	}
	
	public void setNum(int num) {
		numVirusPerTurn = num;
	}
	
	
	/**
	 * end() method - determines when the game ends
	 */
	public int end(int[][] board) {
		int playerOne = 0, playerTwo = 0;
		for (int i = 0; i < board.length; i++)
			for (int j = 0; j < board[i].length; j++)
				if (board[i][j] == 0)
					playerOne++;
				else if (board[i][j] == 1)
					playerTwo++;
		if(playerOne == 0) {
			return 2;
		}
		else if (playerTwo == 0) {
			return 1;
		}
		return 0;
	}
	
	
	public boolean turnEnd(int counter) {
		return (counter >= numVirusPerTurn);
	}
}
